package com.spider.admin.service.client;

import com.spider.admin.exception.SpiderException;
import com.spider.admin.http.entity.PageResult;
import com.spider.admin.store.primary.model.ClientInfo;
import jakarta.validation.constraints.NotNull;

public interface ClientService {
    /**
     * 保存客户端信息
     *
     * @param clientInfo
     * @return
     */
    int saveClient(ClientInfo clientInfo) throws SpiderException;

    /**
     * 查询租户客户端清单（分页）
     * @param tenantId
     * @param page
     * @param pageSize
     * @param clientName
     * @param clientStatus
     * @return
     * @throws SpiderException
     */
    PageResult<ClientInfo> queryClientByTenantId(String tenantId, Integer page, Integer pageSize, String clientName, String clientStatus)throws SpiderException;
    /**
     * 根据ID获取客户端信息
     *
     * @param pid
     * @return
     */
    ClientInfo queryClientById(String pid) throws SpiderException;

    /**
     * 激活客户端
     *
     * @param pid
     * @return
     */
    int activeClient(String pid) throws SpiderException;

    /**
     * 归档客户端
     *
     * @param pid
     * @return
     */
    int archiveClient(String pid) throws SpiderException;

    /**
     * 更新客户端
     *
     * @param clientInfo
     * @param pid
     * @return
     */
    int updateClient(ClientInfo clientInfo, String pid) throws SpiderException;

    /**
     * 重置客户端Key
     * @param pid
     * @return
     * @throws SpiderException
     */
    String changeClientKey(String pid) throws SpiderException;

    /**
     * 删除客户端
     * @param clientId
     * @return
     * @throws SpiderException
     */
    int removeClient(@NotNull String clientId)throws SpiderException;
}

